import { Document, FolderOpened } from '@element-plus/icons-vue'
// import { createRouter } from '@naturefw/ui-elp'
import { createRouter } from '@naturefw/ui-core'

// import { createRouter } from '../../lib/router/router'

// import type { IMenus } from '../../lib/types/90-router'

import home from '../views/home.vue'

// import list from '../views/data-list.vue'

// import list from '../views/plat/p02-table.vue'

// const baseUrl = (document.location.host.includes('.gitee.io')) ?
//  '/nf-rollup-state' :  ''

const url = import.meta.env.BASE_URL
// console.log('url', url)
const baseUrl = url === '/' ? '': '' + url

export default createRouter({
  /**
   * 基础路径
   */
  baseUrl: baseUrl,
  /**
   * 首页
   */
  home: home,

  menus: [
    /*
    {
      menuId: '1',
      title: '支撑平台',
      naviId: '0',
      path: 'plat',
      icon: FolderOpened,
      childrens: [
        {
          naviId: '0',
          menuId: '1010',
          title: '基础表单',
          path: 'form',
          icon: Document,
          component: () => import('../views/00-base/10-crud.vue'),
          childrens: []
        }
      ]
    },
    */
    {
      menuId: '3000',
      title: '增删改查',
      naviId: '0',
      path: 'crud',
      icon: FolderOpened,
      childrens: [
        {
          naviId: '0',
          menuId: '3010',
          title: '基础',
          path: 'base1',
          icon: Document,
          component: () => import('../views/02-crud/02-crud.vue'),
          childrens: []
        }
      ]
    },
    {
      menuId: '4000',
      title: '文档',
      naviId: '0',
      path: 'doc',
      icon: FolderOpened,
      childrens: [
        {
          naviId: '0',
          menuId: '4010',
          title: '数据文档',
          path: 'data',
          icon: Document,
          component: () => import('../views/50-excel/10-excel.vue'),
          childrens: []
        }
      ]
    },
    {
      menuId: '2000',
      title: '系统管理',
      naviId: '0',
      path: 'sys',
      icon: FolderOpened,
      childrens: [
        {
          naviId: '0',
          menuId: '2110',
          title: '角色管理',
          path: 'role',
          icon: Document,
          component: () => import('../views/10-role/role-module.vue'),
          childrens: []
        },
        {
          naviId: '0',
          menuId: '2210',
          title: '部门管理',
          path: 'org',
          icon: Document,
          component: () => import('../views/30-organization/10-organization.vue'),
          childrens: []
        },
        {
          naviId: '0',
          menuId: '2310',
          title: '模块管理',
          path: 'module',
          icon: Document,
          component: () => import('../views/40-module/10-module.vue'),
          childrens: []
        }
      ]
    }
    /*
    {
      menuId: '8000',
      title: '功能演示',
      naviId: '0',
      path: 'demo',
      icon: FolderOpened,
      childrens: [
        {
          naviId: '0',
          menuId: '8100',
          title: '报销单',
          path: 'travelmoney',
          icon: Document,
          component: () => import('../views/80-travel-money/10-submit.vue'),
          childrens: []
        }
      ]
    }*/
  ]
})
